const customerModel = require('../models/customer')




// function checkName(username){
//     const reg = /^[\u4e00-\u9fa5a-zA-Z0-9_-]{4,16}$/
//     return reg.test(username)
//   }


async function checkNameDup(username){
   const usr = await customerModel.findOne({username})

   if(usr){
    return true
   }else{
    return false
   }
}


async function userRegist(data){
    await customerModel.insertMany(data)
}

module.exports = {
    checkNameDup,
    userRegist,
    // checkName
}